package com.wh.usercenter3.service;

import com.wh.usercenter3.pojo.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wh.usercenter3.pojo.User;
import com.wh.usercenter3.pojo.dto.QueryTeamDto;
import com.wh.usercenter3.pojo.dto.TeamQueryDto;
import com.wh.usercenter3.pojo.vo.NewTeamVo;
import com.wh.usercenter3.pojo.vo.PageDataVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 18141
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2025-02-25 15:42:35
*/
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     * @param team
     * @param request
     * @return
     */
    NewTeamVo teamAdd(Team team, HttpServletRequest request);

    /**
     * 分页查询逻辑
     *
     * @param dto 包装类
     * @return 视图类集合
     */
    PageDataVo<List<NewTeamVo>> pageQuery(TeamQueryDto dto);

    /**
     * 加入队伍逻辑
     *
     * @param userId
     * @param teamId
     * @param password
     * @return
     */
    boolean teamJoin(long userId, long teamId, String password);

    /**
     *  退出队伍逻辑
     * @param userId
     * @param teamId
     * @return
     */
    boolean teamQuit(long userId, long teamId);

    /**
     *  更新队伍逻辑
     * @param team
     * @param request
     */
    void teamUpdate(Team team, HttpServletRequest request);

    /**
     * 模糊查询
     * @param dto
     * @param loginUser
     * @return
     */
    List<NewTeamVo> teamList(QueryTeamDto dto, User loginUser);

    /**
     * 删除队伍
     * @param teamId
     * @param userId
     * @return
     */
    boolean teamDel(long teamId, long userId);
}
